#include "LED/led.h"
#include "UART/uart.h"
#include "PLL/pll.h"
#include "PRINT/my_printf.h"

extern __TEXT_START, __TEXT_END;
extern __BSS_START, __BSS_END;


int g_a;

void delay(uint t){
    while(t--);
}

void test(volatile uint *p){
    int i = 0;

    for(; i < 4; i++){
        printf("%x ", *((u8 *)p + i));
    }
    my_putc('\r');
    my_putc('\n');
}


void bss_init(){
    int *start = &__BSS_START;
    int size = &__BSS_END - &__BSS_START;
    int i = 0;

    for(; i < size; i += 4){
        *(start + i) = 0;
    }
}

int main(){
    char ch;
    int i;
    // static int s_a = 10;

    // chg_pll();
    // while((PWRMODE >> 15) & 1);

    // uart0_init(115200);
    led_init();

    // print_PLL();

    while(1){
        ch = my_getc();
        my_putc(ch);
        if(ch == '\r'){
            my_putc('\n');
        }
        
    }

    return 0;
}
